package com.it;

import java.io.UnsupportedEncodingException;

public class StringDemo {
    public static void main(String[] args) throws UnsupportedEncodingException {
        String s1 = "abc";
        String s2 = "Abc";

        //equals(),比较字符串内容，区分大小写
        System.out.println(s1.equals(s2));

        //equalsIgnoreCase(),比较字符串内容，不区分大小写
        System.out.println(s1.equalsIgnoreCase(s2));

        byte[] bytes = "张港余红梅".getBytes("utf-8");
        for (int i = 0; i < bytes.length; i++) {
            System.out.println(bytes[i]);
        }
    }
}
